Read an entire anymap file into memory, returning the
allocated array and filling in the rows, cols, maxval, and
format variables. This function combines ppppnnnnmmmm____rrrreeeeaaaaddddppppnnnnmmmmiiiinnnniiiitttt(((()))),
ppppnnnnmmmm____aaaallllllllooooccccaaaarrrrrrrraaaayyyy(((()))) and ppppnnnnmmmm____rrrreeeeaaaaddddppppnnnnmmmmrrrroooowwww(((()))). Unlike the
equivalent functions in PBM, PGM, and PPM, it returns the
format so you can tell what type the file is.
WWWWRRRRIIIITTTTIIIINNNNGGGG FFFFIIIILLLLEEEESSSS
void pnm_writepnminit( FILE* fp, int cols, int rows, xelval maxval, int format, int forceplain )
Write the header for a portable anymap file. Unlike the
equivalent functions in PBM, PGM, and PPM, you have to
specify the output type. The forceplain flag forces a
plain-format file to be written, as opposed to a raw-format
one.
void pnm_writepnmrow( FILE* fp, xel* xelrow, int cols, xelval maxval, int format, int forceplain )
Write a row from a portable anymap.
void pnm_writepnm( FILE* fp, xel** xels, int cols, int rows, xelval maxval, int format, int forceplain )
Write the header and all data for a portable anymap. This
function combines ppppnnnnmmmm____wwwwrrrriiiitttteeeeppppnnnnmmmmiiiinnnniiiitttt(((()))) and ppppnnnnmmmm____wwwwrrrriiiitttteeeeppppnnnnmmmmrrrroooowwww(((()))).